package wrapperclass;

/**
 * Created by L.jp
 * Description:
 * User: 86189
 * Date: 2022-10-05
 * Time: 12:54
 */
//Integer自动拆装箱
public class Test_Auto_unpacking {
    public static void main(String[] args) {
        //自动拆箱，Integer——>Int
        Integer i1=new Integer(12);
        //底层调用Integer.intValue方法
        int i2=i1;
        System.out.println(i2);
        
        //自动装箱,int——>Integer
        //底层调用Integer.valueOf方法
        Integer i3=12;
        System.out.println(i3);
    }
}
